﻿using Basic.FormCollect;
using Basic.FormLocalEvent.Model;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.FormLocalEvent.PhyQueryGroup
{
    [LocalEventName("Delete")]
    internal class ClearPhyQueryColumn : IEventHandler<PhyQueryGroupEvent>
    {
        private readonly IQueryColumnCollect _Service;

        public ClearPhyQueryColumn ( IQueryColumnCollect service )
        {
            this._Service = service;
        }

        public void HandleEvent ( PhyQueryGroupEvent data, string eventName )
        {
            this._Service.ClearByGroupId(data.Group.Id);
        }
    }
}
